<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMembersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('members', function (Blueprint $table) {
            $table->id();
            $table->string('nickname',100)->nullable()->comment('用户昵称');
            $table->string('avatar',255)->nullable()->comment('用户头像');
            $table->string('openid',100)->comment('粉丝openid');
            $table->tinyInteger('status')->unsigned()->default(1)->comment('用户状态，0=禁用，1=正常');
            $table->integer('balance')->unsigned()->default(0)->comment('用户余额');
            $table->integer('red_balance')->unsigned()->default(0)->comment('用户抢到的红包余额');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('members');
    }
}
